// (c) Copyright 2013-2014 Stephen Gold <sgold@sonic.net>
// Distributed under the terms of the GNU General Public License

/*
 This file is part of the Bats Game.

 The Bats Game is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by the
 Free Software Foundation, either version 3 of the License, or (at your
 option) any later version.

 The Bats Game is distributed in the hope that it will be useful, but
 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 for more details.

 You should have received a copy of the GNU General Public License
 along with the Bats Game.  If not, see <http://www.gnu.org/licenses/>.
 */
package bats.unit;

import jme3utilities.math.VectorXZ;

/**
 * Control interface to walk a unit around on the map.
 * <p>
 * Guidance inputs accumulate between physics ticks, whereupon they are
 * averaged. To discard past guidance, invoke newGuidanceInput().
 *
 * @author Stephen Gold <sgold@sonic.net>
 */
public interface MoveControl {

    /**
     * Get the direction which the unit wants to face.
     *
     * @return a new unit vector
     */
    VectorXZ copyDirectionGoal();

    /**
     * Forget all prior guidance.
     */
    void newGuidanceInput();

    /**
     * Accept destination guidance.
     *
     * @param destination desired map location
     */
    void requestDestination(VectorXZ destination);

    /**
     * Accept horizontal movement guidance relative to the unit.
     *
     * @param forward desired forward movement (in meters)
     * @param rightward desired rightward movement (in meters)
     */
    void requestMove(float forward, float rightward);

    /**
     * Accept horizontal movement guidance relative to the unit.
     *
     * @param offsetMeters desired map offset (in meters)
     */
    void requestOffset(VectorXZ offsetMeters);

    /**
     * Accept turning guidance.
     *
     * @param turn desired turn relative to the unit's current direction goal
     */
    void requestTurn(VectorXZ turn);
}